package ca.ulaval.ift.gloo.SimSolution.model;



public final class ControleurSimulation {

	private static  ControleurSimulation instance = null;
	private Plan plan;
		
	
	private ControleurSimulation() {
		plan = Plan.getInstance();
		
    }
    

    public final static ControleurSimulation getInstance() {
        if (ControleurSimulation.instance == null) {
        	ControleurSimulation.instance = new ControleurSimulation();
        }
 
        return ControleurSimulation.instance;
    }
    
	public Noeud ajouterNoeud(int x, int y){
		Noeud n = new Noeud(plan.getNextIdNoeud(), x, y);
		plan.addNoeud(n);
		return n;
	}
	
	public Arc ajouterArc(int idNoeud1, int idNoeud2, float distance){
		Arc a = new Arc(plan.getNextIdArc(), distance,
						plan.getNoeudById(idNoeud1), plan.getNoeudById(idNoeud2));
		plan.addArc(a);
		return a;
	}
}
